package io;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) throws Exception {

        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream("not.txt",true), StandardCharsets.UTF_8)));
        System.out.println("记事本打开，关闭记事本请输入”exit“");
        Scanner scanner = new Scanner(System.in);
        while (true){
            System.out.println("请输入");
            String a = scanner.nextLine();
            if ("".equals(a)){
                pw.flush();
            }
            if ("exit".equalsIgnoreCase(a)){
                break;
            }
            pw.println(a);
        }
        pw.close();
    }
}
